<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <META NAME="ROBOTS" CONTENT="INDEX, NOFOLLOW">
  <META NAME="Googlebot" CONTENT="nofollow">
  <title>OER Recommender Examples - Inserting Recommendations in Web Pages Using HTML Snippets</title>
  <link href="/stylesheets/default.css?1203966366" media="screen" rel="stylesheet" type="text/css" />

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>

<script type="text/javascript">
_uacct = "UA-73651-4";
urchinTracker();
</script>
	<style type="text/css">
		.oer_recommender_container {font-family:Arial;font-size:98%}
		.oer_recommender_title {font-weight:bold;}
		.oer_recommender_list {}
		.oer_recommender_item {}
		.oer_recommender_more_link {}
		.example {border:black; background-color:#DDD; padding:6px;}
	</style>

</head>

<body>
<h1>OER Recommender Examples - Inserting Recommendations in Web Pages Using HTML Snippets</h1>

<p><a href="integration.html">Return to developer page</a></p>

<ul>
	<li><a href="#1">Basic Example</a></li>
	<li><a href="#2">Inserting Recommendations in a Catalog Page</a></li>
	<li><a href="#3">Snippet Options</a></li>
	<li><a href="#4">Recommendations for Foreign Language Resources</a></li>
	<li><a href="#5">Styling Recommendations</a></li>
</ul>

<hr/>

<a name="1"></a>
<h2>Basic Example</h2>

<p>The recommendations below are generated by inserting the following html snippet in the page:</p>
<pre>
&lt;script type="text/javascript" src="http://www.oerrecommender.org/recommendations.pjs?u=http://ocw.usu.edu/Biological_and_Irrigation_Engineering/Surface_Irrigation_Design"&gt;&lt;/script&gt;
</pre>

<div class="example">
<script type="text/javascript" src="/recommendations.pjs?u=http://ocw.usu.edu/Biological_and_Irrigation_Engineering/Surface_Irrigation_Design"></script>
</div>

<p><b><a href="/recommendations.pjs?u=http://ocw.usu.edu/Biological_and_Irrigation_Engineering/Surface_Irrigation_Design">See the Javascript</a></b></p>

<hr/>

<a name="2"></a>
<h2>Inserting Recommendations in a Catalog Page</h2>

<p>Catalogs that provide the urls of both their catalog pages and the resource pages they describe receive links to both pages when they request recommendations.</p>
<pre>
&lt;script type="text/javascript" src="http://www.oerrecommender.org/recommendations.pjs?u=http://www.oercommons.org/courses/5-068-physical-methods-in-inorganic-chemistry-spring-2005"&gt;&lt;/script&gt;
</pre>

<p>Generates:</p>

<div class="example">
<script type="text/javascript" src="/recommendations.pjs?u=http://www.oercommons.org/courses/5-068-physical-methods-in-inorganic-chemistry-spring-2005"></script>
</div>

<p><b><a href="/recommendations.pjs?u=http://www.oercommons.org/courses/5-068-physical-methods-in-inorganic-chemistry-spring-2005">See the Javascript</a></b></p>

<hr/>

<a name="3"></a>
<h2>Snippet Options</h2>


<dt><b>limit</b></dt>  
<dd>
	Number of items to retrieve. 5 is the default when requesting XML and using the HTML scriptlet. 20 is the maximum that is ever returned.
	<a href="/recommendations?limit=3&details=true&u=http://openlearn.open.ac.uk/course/view.php?name=B821_1">Example</a>
</dd>

<dt><b>title</b></dt>  
<dd>
	Specify <b>true</b> to request a title be displayed above the list of recommendations.
</dd>

<dt><b>more_link</b></dt>  
<dd>
Specify <b>true</b> to request a link to more links be displayed below the list of recommendations.
</dd>

<dt><b>direct_link_text</b></dt>  
<dd>
	Use to specify the anchor text for [direct link] links in catalog pages.
</dd>

<dt><b>details</b></dt>  
<dd>
Specify <b>true</b> to request that all available details be displayed.
</dd>

<dt><b>omit_feeds</b></dt>  
<dd>
Specify a comma delimited list of <a href="/collections">collections</a> to not include in the returned recommendations. 
</dd>

<p>For example:</p>

<p class="code">
&lt;script type="text/javascript" src="http://www.oerrecommender.org/recommendations.pjs?<br/>details=true&limit=12&title=true&more_link=true&direct_link_text=[go]<br/>&u=http://www.oercommons.org/courses/molecular-spectra-and-molecular-structure-spring-1996"&gt;&lt;/script&gt;
</p>

<p>Generates:</p>

<div class="example">
<script type="text/javascript" src="/recommendations.pjs?details=true&limit=12&title=true&more_link=true&direct_link_text=[go]&u=http://www.oercommons.org/courses/molecular-spectra-and-molecular-structure-spring-1996"></script>
</div>

<p><b><a href="/recommendations.pjs?details=true&limit=12&title=true&more_link=true&direct_link_text=[go]&u=http://www.oercommons.org/courses/molecular-spectra-and-molecular-structure-spring-1996">See the Javascript</a></b></p>

<hr/>

<a name="4"></a>
<h2>Recommendations for Foreign Language Resources</h2>

<p>When requesting recommendations for foreign languages, the title and more related resources link are displayed in the language of the document.</p>

<pre>
&lt;script type="text/javascript" src="http://www.oerrecommender.org/recommendations.pjs?title=true&more_link=true&u=http://cnx.org/content/col10516/latest/"&gt;&lt;/script&gt;
</pre>

<p>Generates:</p>

<div class="example">
<script type="text/javascript" src="/recommendations.pjs?title=true&more_link=true&u=http://cnx.org/content/col10516/latest/"></script>
</div>

<p><b><a href="/recommendations.pjs?title=true&more_link=true&u=http://cnx.org/content/col10516/latest/">See the Javascript</a></b></p>

<hr />

<a name="5"></a>
<h2>Styling Recommendations</h2>

<p>Use the following styles to style the list:</p>
<pre>
.oer_recommender_container {}
.oer_recommender_title {}
.oer_recommender_list {}
.oer_recommender_item {}
.oer_recommender_more_link {}
.oer_recommender_recommendation_link {}
.oer_recommender_direct_link {}
.oer_recommender_published_at {}
.oer_recommender_relevance_score {}
.oer_recommender_description {}
.oer_recommender_uri {}
</pre> 

</body>
</html>